
package com.yonyou.pmclouds.problemlog.entity;

import com.yonyou.pmclouds.assigninfo.entity.AssignInfoVO;
import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.copyperson.entity.CopyPersonVO;
import com.yonyou.pmclouds.repairlog.entity.RepairLogVO;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Table(name="pm_problemlog")
@Setter
@Getter
public class ProblemLogVO extends SuperVO{

    
    private static final long serialVersionUID = -1176633435668855964L;
   
    /**
     * 项目
     */
    public static String PK_PROJECT= "pk_project";
    /**
     * 工序
     */
    public static String PK_PROCESS = "pk_process";
    /**
     * 问题原因
     */
    public static String PK_PROBLEMREASON = "pk_problemreason";
    /**
     * 整改人
     */
    public static String PK_RECTIFICATIONER = "pk_rectificationer";
    /**
     * 整改人姓名
     */
    public static String RECTIFICATIONER_NAME = "rectificationer_name";
    /**
     * 单据状态
     */
    public static String BILLSTATUS = "billstatus";
    /**
     * 问题描述
     */
    public static String CONTENT = "content";
    /**
     * 制单人主键
     */
    public static String CREATOR = "creator";
    /**
     * 制单人名字
     */
    public static String CREATOR_NAME = "creator_name";

    public static String END_DATE = "enddate";

    // 区分移动端操作构造不同的通知内容
    public static String OPERATION_ADD = "add";

    public static String OPERATION_ASSIGN = "assign";

    public static String OPERATION_REPAIR = "repair";

    public static String OPERATION_PASS = "pass";

    public static String OPERATION_NO_PASS = "repairTo";

    /**
     * 需要包装属性的参照字段
     */
    public static String[] REF_FILEDS ={PK_PROJECT,PK_PROCESS,PK_PROBLEMREASON,PK_RECTIFICATIONER};
    /**问题记录单单据字段**/
    @Id
    private String pk_problem;
    private String pk_project;
    private String pk_problemreason;
    private String content;
    private String pk_process;
    private String pk_rectificationer;

    private String pk_siteinspection;   //现场检查主键
    private String pk_inspectitem;      //检查项主键

    private String improvement_area; //整改区域

    // 抄送人
    @Transient
    private List<CopyPersonVO> copyPersonVOS;

    private Date enddate;

    @Transient
    private RepairLogVO[] repairlogs;
    
    /**前台页面显示字段*/
    @Transient
    private String project_name;
    @Transient
    private String project_code;
    @Transient
    private String problemreason_name;
    @Transient
    private String rectificationer_name;
    @Transient
    private String process_name;
    @Transient
    private int picNum;
    @Transient
    private String creator_name;
    @Transient
    private String[] pictures;
    @Transient
    private boolean overTime;
    
    
    /**单据通用字段**/
    @Column(name="pk_tenant",updatable=false)
    private String pk_tenant;
    @Column(name="creator",updatable=false)
    private String creator;
    @Column(name="creationtime",updatable=false)
    private Date creationtime;
    private String modifier;
    private Date modifytime;
    // 经度
    private BigDecimal longitude;
    // 纬度
    private BigDecimal latitude;
    // 位置信息
    private String position;
    private String bill_type;
    private byte billstatus;


    @Transient
    private String strCreationtime;
    @Transient
    private String picture_address; // 照片真实地址(用于存储HTML形式)
    @Transient
    private String orgName;
    @Transient
    private String strenddate;
    @Transient
    private String strBillstatus;
    @Transient
    private String pkRectifyEnter;
    @Transient
    private String rectifyEnterName;
    @Transient
    private List<AssignInfoVO> assignVOList;
    @Transient
    private String operation;
    @Transient
    private String modifierName;



    public String taskReceiverField(){
        return PK_RECTIFICATIONER;
    }
}
